Repository navigation
perf(zisk): drop the software G1 subgroup pre-check of BLS12-381 precompiles - #62
Merged
figtracer merged 1 commit intoNov 16, 2026
Conversation
…MSM and pairing The ZisK guest ran revm's arkworks DefaultCrypto G1 MSM with zero scalars on every input point before calling ZisK's G1 MSM and pairing, only to reject points outside the G1 subgroup. That workaround dates from ZisK 1.0.0-alpha, whose subgroup check used incomplete point formulas. Since ZisK 1.1.0-alpha (zisk 4ba9bd7ad) the check uses complete formulas, and the guest-side MSM and pairing reject such points with an error code in both the guest and the hint paths. The repo pins ZisK 1.4.0-alpha through ere v0.20.0, so the pre-check only costs cycles: removing it makes BLS12-381 G1 MSM about 33x cheaper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes
validate_zisk_bls12_g1_subgroups, which ran arkworks on every G1 point before ZisK's BLS12-381 G1 MSM and pairing.Why it existed
It was added against ZisK
1.0.0-alpha, whose G1 subgroup check used incomplete point formulas and panicked in the hints on points outside the subgroup.Why it is no longer needed
Since ZisK
1.1.0-alpha(with 0xPolygonHermez/zisk@4ba9bd7ad), the check uses complete formulas. The guest MSM and pairing return an error for such points, and the hints do not panic.Benchmark
Estimated cost on ZisK
1.4.0-alpha, 112test_bls12_381.pytests fromtests-zkevm-benchmark@v21.0.5(60M to 200M gas):test_bls12_g1_msmtest_bls12_pairing_uncachabletest_bls12_pairingtest_bls12_381_uncachabletest_bls12_381test_bls12_g2_msm